﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Authorization
{
    /// <summary>
    /// Colecao de propriedades atributas a um usuario.
    /// Jose Mauro - Rerum 18/05/2011 IM120338
    /// </summary>
    public class RoleAssignmentUserCollection : System.Collections.ObjectModel.Collection<RoleAssignmentUser>
    {
        #region Constructor

        /// <summary>
        /// default constructor
        /// </summary>
        public RoleAssignmentUserCollection()
        {                        
        }

        public RoleAssignmentUserCollection(IList<RoleAssignmentUser> list)
            : base(list)
        { 
        }

        #endregion

        #region Methods

        /// <summary>
        ///  Lista dos Nomes dos <see cref="RoleCollection"/>
        /// </summary>
        /// <returns>Array de String com os names dos <see cref="RoleCollection"/></returns>
        public string[] Names()
        {
            var names = new string[Count];

            for (var i = 0; i < Count; i++)
                names[i] = this[i].RoleAssignment;

            return names;
        }

        #endregion

    }
}
